<template>
    <div class="data-content">
        <el-table :data="hmd" border style="width: 100%">
            <el-table-column prop="deptname" label="企业名称" width="150" >
            </el-table-column>
            <el-table-column prop="behavior" label="决定内容" min-width="120" :show-overflow-tooltip="true">
            </el-table-column>
            <el-table-column label="发布有效期至" width="120" >
                <template slot-scope="scope">
                    <div>{{scope.row.publicityTime == null ? "无" : scope.row.publicityTime}}</div>
                </template>
            </el-table-column>
            <el-table-column prop="implementationdept" label="实施部门" min-width="150"  >
            </el-table-column>
            <el-table-column prop="approvalcode" label="文号" :show-overflow-tooltip="true">
            </el-table-column>
        </el-table>
        <el-pagination
            @size-change="handleSizeChange"
            @current-change="handleCurrentChange"
            :page-sizes="[10, 15, 20]"
            :page-size="pageSize"
            layout="total, sizes, prev, pager, next"
            style="text-align:right; margin-top:1em;"
            :total="total">
        </el-pagination>
    </div>
</template>

<script>
export default {
    props: {
        companyName: {
            type: String,
            default: "",
        },
        projectId: {
            type: String,
            default: "",
        },
    },
    data: () => ({
        hmd: [],
        pageNum: 1,
        pageSize: 10,
        total: null,
    }),
    methods: {
        handleSizeChange: function (pageSize) {
            this.pageSize = pageSize;
            this.getResultList();
        },
        handleCurrentChange: function (pageNum) {
            this.pageNum = pageNum;
            this.getResultList();
        },

        // 获取 四库一平台人员 列表
        getResultList: function () {
            // let loading = this.$loading({
            //     lock: true,//lock的修改符--默认是false
            //     text: 'Loading',//显示在加载图标下方的加载文案
            //     spinner: 'el-icon-loading',//自定义加载图标类名
            //     background: 'rgba(0, 0, 0, 0.5)',//遮罩层颜色
            //     // target: document.querySelector('#table')//loadin覆盖的dom元素节点
            // });
            let dataList = {
                    page:{
                        current: this.pageNum,
                        size: this.pageSize,
                    },
                    corpName: this.companyName,
                    projectId: this.projectId,
    
            }
            let that = this;
            this.$post(
                `${that.$store.state.api.searchUrl}/searchblack/guangxiblack`,
                dataList,
                (data) => {
                    // loading.close()
                    that.hmd = data.rows
                    that.total = data.total
                },
                true
            )
        },
        toZizhiInfo: function () {},
    },
    mounted() {
        this.getResultList();
    },
};
</script>

<style scoped lang="scss">
.data-content {
    // border-bottom: 1px solid #efefef;
    padding:0px 15px;
}
</style>
